﻿#pragma once
#include <llvm/IR/Value.h>
#include <llvm/IR/IRBuilder.h>

class AstType;
class CodeGen {
public:
	AstType* type = nullptr;
	virtual llvm::Value* generateCode(llvm::Module *m, llvm::Function *func, llvm::IRBuilder<>&) = 0;
	/// 获取右值
	llvm::Value* load(llvm::IRBuilder<>& builder, llvm::Value* v);
	virtual void setHopeType(AstType* type) {
		this->type = type;
	}
};
